home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / TOTDEMO.ARJ / DEMMN3.PAS < prev    next >
Pascal/Delphi Source File  |  1991-02-11  |  2KB  |  53 lines

  1. program DemoMenuThree;
  2. {DEMMN3 - nested pop-up menus}
  3.  
  4. USES  DOS, CRT,
  5.       totMENU, totFAST, totLOOK, totSYS;
  6.  
  7. var
  8.   Main,
  9.   Load: MenuOBJ;
  10.  
  11.   Choice: byte;
  12. begin
  13.    Screen.PartClear(1,1,80,24,white,'░'); {paint the screen}
  14.    Screen.PartClear(1,24,80,25,30,' ');
  15.    with Load do
  16.    begin
  17.       Init;
  18.       AddItem('');
  19.       AddFullItem(' ~1~  Accounts Payable    ',11,49,'Load database ACTP1',nil);
  20.       AddFullItem(' ~2~  Accounts Receivable ',12,50,'Load database ACTR7',nil);
  21.       AddFullItem(' ~3~  Net Assets Employed ',13,51,'Load the ledger file',nil);
  22.       AddFullItem(' ~4~  Net Cash Flow       ',14,52,'Load the cash file',nil);
  23.       SetStyleTitle(6,'Load Menu');
  24.       SetActiveItem(2);
  25.       SetMessageXY(25,25);
  26.       SetGap(1);
  27.       Win^.SetClose(False);
  28.    end;
  29.    with Main do
  30.    begin
  31.       Init;
  32.       AddItem('');
  33.       AddFullItem(' ~1~   Load a file         ',1,49,'Loads a new database file',@Load);
  34.       AddFullItem(' ~2~   Edit Date            ',2,50,'Full screen editing of data base entries',nil);
  35.       AddFullItem(' ~3~   Save the file        ',3,51,'Save database file to disk',nil);
  36.       AddFullItem(' ~4~   Change configuration ',4,52,'Modify colors and defaults',nil);
  37.       AddItem('');
  38.       AddFullItem(' ~Q~   Quit                 ',99,81,'Exit system and return to DOS',nil);
  39.       SetStyleTitle(6,'Main Menu');
  40.       SetActiveItem(2);
  41.       SetMenuXY(0,4);
  42.       SetMessageXY(25,25);
  43.       SetGap(1);
  44.       Win^.SetClose(False);
  45.       Choice := Activate;
  46.       Done;
  47.       Load.Done;
  48.    end;
  49.    if Choice = 0 then
  50.       Writeln('You escaped')
  51.    else
  52.       Writeln('You selected menu item ',Choice);
  53. end.